﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HRM.Entity;

namespace HRM.DAL
{
    public class PositionDAL: BaseDAL
    {
        public List<Position> GetAll()
        {
            return Repository.All<Position>().ToList();
        }

        public Position GetByID(int ID)
        {
            return Repository.Single<Position>(pos => pos.ID == ID);
        }

        public Position Add(Position position)
        {
            Repository.Add<Position>(position);
            return position;
        }

        public void Delete(int ID)
        {
            Repository.Delete<Position>(ID);
        }

        public Position Update(Position position)
        {
            Repository.Update<Position>(position);
            return position;
        }
    }
}
